package iosr11.data;

import java.util.ArrayList;
import java.util.List;

public class ProjectGroup extends Entity{
	private String groupName;
	private ProjectSubject subject;
	private List<Student> students;
	
	public ProjectGroup(){
	}
	
	public ProjectGroup(String id, ProjectSubject subject, List<Student> students){
		super(id);
		this.subject = subject;
		this.students = students;
	}
	
	public ProjectGroup(String id, String groupName, ProjectSubject subject, List<Student> students){
		super(id);
		this.groupName = groupName;
		this.subject = subject;
		this.students = students;
	}
	
	public ProjectSubject getSubject() {
		return subject;
	}

	public void setSubject(ProjectSubject subject) {
		this.subject = subject;
	}
	
	public boolean belongsToGroup(Student student) {
		return students.contains(student);
	}

	public List<Student> getStudents() {
		return students;
	}

	public void setStudents(List<Student> students) {
		this.students = students;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
	
	public void addStudent(Student student){
		if (this.students==null){
			this.students=new ArrayList<Student>();
		}
		this.students.add(student);
	}
	
}
